package com.clz.hyperit.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

import com.clz.hyperit.util.IdAnnotationin;
import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "question", catalog = "hyperit")
public class Question {

	@IdAnnotationin
	private Integer id;
	private String title;
	private String content;
	private Integer userDetail_id;
	private String createtime;
	private Integer accept; // 0：未采纳 最佳答案的ID
	private Integer answer;
	private Integer reading;
	public Question() {
	
	}

	public Question(Integer id, String createtime) {
	
		this.id = id;
		this.createtime = createtime;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "content")
	public String getContent() {
		return content;
	}

	@Column(name = "name")
	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "userdetail_id")
	public Integer getUserDetail_id() {
		return userDetail_id;
	}

	public void setUserDetail_id(Integer userdetail_id) {
		this.userDetail_id = userdetail_id;
	}

	@Generated(GenerationTime.INSERT)
	@Column(name = "createtime")
	public String getCreatetime() {
		return createtime;
	}

	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}

	@Column(name = "accept")
	public Integer getAccept() {
		return accept;
	}

	public void setAccept(Integer accept) {
		this.accept = accept;
	}

	@Column(name = "answer")
	public Integer getAnswer() {
		return answer;
	}

	public void setAnswer(Integer answer) {
		this.answer = answer;
	}
	@Column(name = "reading")
	public Integer getReading() {
		return reading;
	}

	public void setReading(Integer reading) {
		this.reading = reading;
	}

	@Override
	public String toString() {
		return "Question [id=" + id + ", title=" + title + ", content="
				+ content + ", userDetail_id=" + userDetail_id
				+ ", createtime=" + createtime + ", accept=" + accept
				+ ", answer=" + answer + ", reading=" + reading + "]";
	}





}
